﻿/*                       NOTICE
 * 
 * This software was produced for the U. S. Government
 * under Contract No. FA8721-10-C-0001, and is
 * subject to the Rights in Noncommercial Computer Software
 * and Noncommercial Computer Software Documentation Clause
 * (DFARS) 252.227-7014 (JUN 1995)
 * 
 * Approved for Public Release: 11-2435
 * © 2011 The MITRE Corporation. All Rights Reserved. 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GRIP
{
    /// <summary>
    /// A holder class encapsulating all of the settings associated with a FingerFinder.
    /// Use this to define the initial conditions of the device.
    /// </summary>
    public class FingerSettings : ISettingManager
    {
        /// <summary>
        /// The depth, in millimeters, your hands must be in front of your body in order to engage finger tracking.
        /// </summary>
        public int HandBodyDifferenceThreshold = 200;

        /// <summary>
        /// The distance, in pixels, from the left side of your hand to your palm.
        /// </summary>
        public int HandWidth = 70;

        /// <summary>
        /// The distance, in pixels, from the tip of your tallest finger to your palm.
        /// </summary>
        public int HandHeight = 70;

        /// <summary>
        /// The length (depth), in millmeters, of your hand.
        /// </summary>
        public int HandLength = 60;

        /// <summary>
        /// The threshold angle, in degrees, that distinguishes between a thumb / index finger pair and an index / middle finger pair.
        /// The first pair of finger points will look at this. Anything less will be called an index / middle finger pair, while anything
        /// greater will be processed further.
        /// </summary>
        public int ThumbIndexThreshold = 60;

        /// <summary>
        /// The threshold angle, in degrees, for distinguishing a thumb / middle finger pair. The first pair is checked against this
        /// if it's larger than ThumbIndexThreshold. A value less than this will be considered a thumb / index finger pair, and a value
        /// larger than this will be processed further.
        /// </summary>
        public int ThumbMiddleThreshold = 100;

        /// <summary>
        /// The threshold angle, in degrees, for distinguishing a thumb / pinky finger pair. The first pair is checked against this
        /// if it's larger than ThumbMiddleThreshold. A value less than this will be considered a thumb / middle finger pair, and a value
        /// larger than this will be considered a thumb / pinky pair.
        /// </summary>
        public int ThumbPinkyThreshold = 120;

        /// <summary>
        /// The threshold angle, in degrees, for distinguishing an index finger / pinky pair. The second pair is checked against this.
        /// A value less than this will be called an index finger / middle finger pair, and a value larger than this will be considered
        /// an index finger / pinky pair.
        /// </summary>
        public int IndexPinkyThreshold = 50;

        /// <summary>
        /// The threshold angle, in degrees, for distinguishing a middle finger / pinky pair. The third pair is checked against this.
        /// A value less than this will be called a middle finger / ring finger pair, and a value larger than this will be considered
        /// a middle finger / pinky pair.
        /// </summary>
        public int MiddlePinkyThreshold = 50;

        /// <summary>
        /// The time, in milliseconds, that a finger must remain visible before it's considered alive. Used to filter any temporary flickering points.
        /// NOTE: as of 2.1, this is temporarily deprecated. Use KinectEntryBufferTime in KinectSettings instead.
        /// </summary>
        public int FingerEntryBufferTime = 200;

        /// <summary>
        /// The time, in milliseconds, that a finger must not be visible before it's considered dead. Used to filter any temporary flickering points.
        /// NOTE: as of 2.1, this is temporarily deprecated. Use KinectExitBufferTime in KinectSettings instead.
        /// </summary>
        public int FingerExitBufferTime = 200;

        /// <summary>
        /// The radius, in pixels, of jitter filtering. Any finger movement below this radius will be ignored.
        /// </summary>
        public int JitterFilterRadius = 10;

        /// <summary>
        /// The radius, in pixels, of smoothing. Any finger movement above this radius will be clipped to this radius, causing
        /// slower but smoother motion.
        /// </summary>
        public int SmoothingRadius = 30;

        /// <summary>
        /// Setting used for Candescent NUI's finger point detection
        /// </summary>
        public float MinimumDistanceBetweenFingerPoints = 22;

        /// <summary>
        /// Setting used for Candescent NUI's finger point detection
        /// </summary>
        public float MinimumDistanceIntersectionPoints = 18;

        /// <summary>
        /// Setting used for Candescent NUI's finger point detection
        /// </summary>
        public float MinimumDistanceFingerPointToIntersectionLine = 16;

        /// <summary>
        /// Setting used for Candescent NUI's finger point detection
        /// </summary>
        public float MaximumDistanceBetweenIntersectionPoints = 23;
    }
}
